package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.wap.common.SqlName;
import com.financing.wap.dao.IFpPhoneClientDao;
import com.financing.wap.dto.FpPhoneClientDTO;
/**
 * fp_phone_client  
 * 用户手机端客户 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpPhoneClientDao")
public class FpPhoneClientDaoImpl extends BaseDaoImpl<FpPhoneClientDTO, java.lang.Integer> implements IFpPhoneClientDao {


	@Override
	public int insert(FpPhoneClientDTO fpPhoneClient) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.FpPhoneClientSql.insert, fpPhoneClient);
	}

	@Override
	public void update(FpPhoneClientDTO fpPhoneClient) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpPhoneClientSql.update, fpPhoneClient);
	}

	@Override
	public void updateForce(FpPhoneClientDTO fpPhoneClient) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpPhoneClientSql.updateForce, fpPhoneClient);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.FpPhoneClientSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpPhoneClientDTO> queryList(FpPhoneClientDTO fpPhoneClient) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.FpPhoneClientSql.queryList, fpPhoneClient);
	}

	@Override
	public int queryListCount(FpPhoneClientDTO fpPhoneClient) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.FpPhoneClientSql.queryListCount, fpPhoneClient);
	}

	@Override
	public FpPhoneClientDTO loadById(Integer id) throws SQLException {
		return  (FpPhoneClientDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.FpPhoneClientSql.loadById,id);
	}

	@Override
	public Class<FpPhoneClientDTO> getEntityClass() {
		return FpPhoneClientDTO.class;
	}

	@Override
	public Map<String, String> queryWechatAndFlagAdd(
			FpPhoneClientDTO fpPhoneClient) throws SQLException {
		return (Map<String, String>) this.getSqlMapClientTemplate().queryForObject(SqlName.FpPhoneClientSql.queryWechatAndFlagAdd,fpPhoneClient);
	}
 	
}
